<?//baoming
$treestr = "";
$treestr = build_user_tree(0,0);
function build_user_tree($level,$parent_id)
{
		global $conn,$treestr,$_SESSION;
		$sql="SELECT p.* FROM teacher_pop m , pop_info p WHERE m.pop_id = p.pop_id AND m.t_id=".$_SESSION[Admin][t_id]." and p.pop_level=$level and p.pop_parent=$parent_id ORDER BY pop_rank ";
		//echo "$sql";
		$RS = $conn->Execute($sql);
		if($RS->RecordCount()>0)
		{
			while(!$RS->EOF)
			{
				$treestr .= '<DSTree text="'.$RS->fields('pop_name').'" target="main" open="true" 				 				treeId="'.$RS->fields('pop_id').'" href="admin.php?act='.$RS->fields("pop_code").'">';




				build_user_tree(($level+1),$RS->fields('pop_id'));
				$RS->MoveNext();
			}
			$treestr .= '</DSTree>';
		}
		else	
			$treestr .= "</DSTree>";
		return $treestr;
}

$treestr = substr($treestr,0,(strlen($treestr)-9));
$t_name=$_SESSION[Admin][t_name];
$shenfen = getNameFromArray($_SESSION[Admin][is_admin],$aListAdmin);
include printEOT('left');
?>